
import random

def compute_score(index, find = False):

    if not find:
        return 0

    if index <= 7:
        return 100
    else:
        return 100 - (index-7)*5


def guess():

    print('Hi, 我叫果果老师， 猜猜我今年几岁了？ ')
    right = random.randint(1,1000)

    index = 0
    find = False

    while True:
        index = index + 1
        age = input('请输入你猜的年龄：')
        age = int(age)

        if age == right:
            print('恭喜你，你猜对了')
            find = True
            break

        else:
            if age < right:
                print('你的数太小了！')
            else:
                print('你的数太大了！')

        if index == 10:
            print('哇，你太笨了！')


        if index >= 15:
            print('哎，你笨死了！')
            break

    score = compute_score(index, find)
    print("score is %s" % score)


if __name__ == '__main__':
    guess()
